function moneyFormat(V)
{
    var intPart,decPart
    ret=V*100;ret=Math.round(ret);
    ret=V<.1?"0"+ret:ret;
    ret=V< 1?"0"+ret:""+ret;
    intPart=ret.substring(0,ret.length-2);
    decPart=ret.substring(ret.length-2);
    ret=intPart+"."+decPart;
    return(ret);
}

function format_money(el)
{
    el.value=moneyFormat(decimals(el.value));
}

function format_int(el)
{
    el.value=integers(el.value)
    if (el.value == '')
        el.value = '0';
}

function decimals(str){ return(clean(str,"1234567890.")) }

function integers(str){ return(clean(str,"1234567890")) }

function clean(str,permitted)
{
    str=""+str;
    var nchar,n;var out="";
    for(n=0;n<str.length;n++)
    {
        nchar=str.charAt(n);
        out+=permitted.indexOf(nchar)>-1?nchar:"";
    }
    return(out);
}

function noenter() {
  return !(window.event && window.event.keyCode == 13); }

